const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');



module.exports = {
  mode: 'production',
  // * 入口
  entry: './Arknights/main.js',
  // * 出口
  output: {
    // * 出口路径
    path: path.join(__dirname, '../脚本/production'),
    //  * 压缩后的文件名
    filename: 'Dev-Test.js'
  },
  module: {
    rules: [
      {
        test: /\.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      }
    ]
  },
  // 代码混淆
  optimization: {
    minimizer: [new UglifyJsPlugin()],
  },

}
